/**
 * 
 */
package com.antilia.infomaresme.pages.alert;

import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.extensions.ajax.markup.html.tabs.AjaxTabbedPanel;
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.extensions.markup.html.tabs.PanelCachingTab;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;

/**
 * @author Ernesto
 *
 */
public class AlertsPanel extends Panel {

	private static final long serialVersionUID = 1L;

	/**
	 * @param id
	 */
	public AlertsPanel(String id) {
		super(id);
		
		List<ITab> tabs = new ArrayList<ITab>();
		tabs.add(new PanelCachingTab(new AbstractTab(Model.of("Alertas sobre anuncios")) {
			
			private static final long serialVersionUID = 1L;

			@Override
			public WebMarkupContainer getPanel(String panelId) {
				return new ListUserItemAllertsPanel(panelId);
			}
		}));		
		tabs.add(new PanelCachingTab(new AbstractTab(Model.of("Alertas sobre catagorias")) {
			
			private static final long serialVersionUID = 1L;

			@Override
			public WebMarkupContainer getPanel(String panelId) {
				return new CategoryAlertsPanel(panelId);
			}
		}));
		add(new AjaxTabbedPanel("tabs", tabs));
	}

}
